<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.33">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica; min-height: 22.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Helvetica}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px}
p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #606060}
p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #961e1e}
p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
span.s1 {font: 18.0px Helvetica}
span.s2 {color: #000000}
span.s3 {color: #001cb9}
span.s4 {font: 10.0px Monaco}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>AtsSynth<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b></span><b>Resynthesize sine data from an ATS analysis file</b></p>
<p class="p2"><br></p>
<p class="p3"><b>AtsSynth.ar(atsbuffer, numPartials, partialStart, partialSkip, filePointer, freqMul, freqAdd, mul, add)</b></p>
<p class="p4"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p3"><b>- resynthesizes information from an ATS file, with transformations.</b></p>
<p class="p4"><br></p>
<p class="p3"><b><span class="Apple-tab-span">	</span>atsbuffer -<span class="Apple-converted-space"> </span></b> the buffer number that contains the AtsFile information</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>numPartials - </b>the number of partials to synthesize</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>partialStart -</b> the partial in the analysis to start the synthesis on. Partial 0 is the first partial.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>partialSkip -</b> an integer that indicates the increment of from partialStart of which partials to synthesize.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>filePointer -</b> a value (between 0 and 1) that indicates which part of the file to synthesize.<span class="Apple-converted-space">  </span>Accepts ugens<span class="Apple-converted-space"> </span></p>
<p class="p3"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>or a static value.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>freqMul -</b> a multiplier on the sinusoidal frequency information.</p>
<p class="p3"><b><span class="Apple-tab-span">	</span>freqAdd - </b>a value to add to frequency information.</p>
<p class="p4"><span class="Apple-tab-span">	</span></p>
<p class="p3"><b>**WARNING** </b>If you try to resynthesize partials that don't exist, those partials will fail silently.<span class="Apple-converted-space">  </span>All valid partials will still be synthesized.</p>
<p class="p4"><br></p>
<p class="p5"><b>Usage</b></p>
<p class="p4"><span class="Apple-tab-span">	</span><span class="Apple-converted-space"> </span></p>
<p class="p3">For resynthesis purposes, an ATS file needs to be loaded into a buffer.<span class="Apple-converted-space">  </span>When loading an ATS file, you need to supply a buffer number to store ATS data in.</p>
<p class="p4"><br></p>
<p class="p6">s.boot;</p>
<p class="p7"><br></p>
<p class="p8"><span class="s2">a = </span><span class="s3">AtsFile</span><span class="s2">.new(</span>"sounds/a11wlk01.ats"<span class="s2">).load;</span></p>
<p class="p7"><br></p>
<p class="p9"><span class="s2">( </span>//play just the resynth, with LFSaw pointing into the file</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="s3">AtsSynth</span>.ar(a.bufnum, a.numPartials, 0, 1,<span class="Apple-converted-space"> </span></p>
<p class="p10"><span class="s4"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>filePointer: </span><span class="s3">LFSaw</span>.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)<span class="s4">, mul: 1)</span></p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
<p class="p4"><br></p>
<p class="p9"><span class="s2">( </span>//multiply frequencies by 1.5</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="s3">AtsSynth</span>.ar(a.bufnum, a.numPartials, 0, 1,<span class="Apple-converted-space"> </span></p>
<p class="p10"><span class="s4"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>filePointer: </span><span class="s3">LFSaw</span>.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)<span class="s4">, freqMul: 1.5, mul: 1)</span></p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
<p class="p4"><br></p>
<p class="p9"><span class="s2">( </span>//add 100 to all frequencies</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="s3">AtsSynth</span>.ar(a.bufnum, a.numPartials, 0, 1,<span class="Apple-converted-space"> </span></p>
<p class="p10"><span class="s4"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>filePointer: </span><span class="s3">LFSaw</span>.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)<span class="s4">, freqAdd: 100.0, mul: 1)</span></p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
<p class="p4"><br></p>
<p class="p9"><span class="s2">( </span>//resynthesize every third partial only (partial skip)</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="s3">AtsSynth</span>.ar(a.bufnum, a.numPartials * 0.3, 0, 3,<span class="Apple-converted-space"> </span></p>
<p class="p10"><span class="s4"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>filePointer: </span><span class="s3">LFSaw</span>.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)<span class="s4">, mul: 1)</span></p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
<p class="p4"><br></p>
<p class="p9"><span class="s2">( </span>//resynthesize only the top half of the partials</p>
<p class="p6">{</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="s3">AtsSynth</span>.ar(a.bufnum, a.numPartials * 0.5, a.numPartials * 0.5, 1,<span class="Apple-converted-space"> </span></p>
<p class="p10"><span class="s4"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>filePointer: </span><span class="s3">LFSaw</span>.kr(a.sndDur.reciprocal, 1, 0.5, 0.5)<span class="s4">, mul: 1)</span></p>
<p class="p6"><span class="Apple-tab-span">	</span>}.play(s);</p>
<p class="p3">);</p>
</body>
</html>
